Skip to content

Consolidate graph operations into unified module and migrate report handling#91

Merged
jfrench9 merged 4 commits intomainfrom
feature/graph-ops
Apr 16, 2026
Merged

Consolidate graph operations into unified module and migrate report handling#91
jfrench9 merged 4 commits intomainfrom
feature/graph-ops

Conversation

@jfrench9
Copy link
Copy Markdown
Member

Summary

Refactors the client SDK by consolidating scattered API operations (backup, restore, materialize, subgraph management, tier upgrades) into a unified graph_operations module, and migrates report handling from a standalone ReportClient into LedgerClient.

Key Changes

Unified Graph Operations Module

  • Consolidated API layer: Replaced separate api/backup/, api/materialize/, and api/subgraphs/ directories with a single api/graph_operations/ module containing:
    • op_create_backup — backup creation
    • op_restore_backup — backup restoration
    • op_materialize — graph materialization
    • op_create_subgraph — subgraph creation
    • op_delete_subgraph — subgraph deletion
    • op_upgrade_tier — tier upgrade operations
  • All operations now follow a consistent op_* naming convention, improving discoverability and maintainability.

Client Consolidation

  • Removed MaterializationClient: Its responsibilities have been absorbed into GraphClient, which now serves as the single entry point for all graph-related operations.
  • Migrated report handling to LedgerClient: Removed ReportClient references and implemented report functionality directly in LedgerClient.
  • Updated facade.py and clients/__init__.py to reflect the simplified client hierarchy.

Model Simplification

  • Renamed and streamlined models to match the operation-centric pattern:
    • delete_subgraph_request.pydelete_subgraph_op.py
    • backup_restore_request.pyrestore_backup_op.py
    • materialize_response_limit_check_type_0.pyupgrade_tier_op.py
  • Removed now-redundant response models (delete_subgraph_response, materialize_request, materialize_response, materialize_status_response).
  • Updated operation_envelope.py to accommodate the new operation types.

Breaking Changes

⚠️ This is a breaking change for consumers of the SDK.

  • MaterializationClient has been removed — callers must use GraphClient instead.
  • ReportClient references removed — use LedgerClient for report operations.
  • Several model classes have been renamed or removed; any direct imports of the old models will break.
  • API module paths have changed (api.backup.*, api.materialize.*, api.subgraphs.create_subgraph, api.subgraphs.delete_subgraph are all removed).

Testing Notes

  • test_materialization_client.py has been updated to reflect the new client structure and operation patterns.
  • test_extensions.py updated for model/import changes.
  • Verify that all graph operations (backup, restore, materialize, subgraph CRUD, tier upgrade) function correctly end-to-end after the consolidation.
  • Confirm LedgerClient report handling works as expected in place of the former ReportClient.

Infrastructure Considerations

  • Downstream services and CI pipelines that depend on the removed clients or old import paths will need to be updated.
  • Documentation and SDK usage examples should be revised to reference the new graph_operations module and consolidated client interfaces.
  • The net reduction of ~1,200 lines indicates significant deduplication, which should reduce long-term maintenance burden.

🤖 Generated with Claude Code

Branch Info:

  • Source: feature/graph-ops
  • Target: main
  • Type: feature

Co-Authored-By: Claude noreply@anthropic.com

This commit removes the existing `create_backup.py` and `restore_backup.py` files and introduces new modules under `graph_operations` for handling backup and restore operations. The new structure enhances organization and aligns with the overall architecture of the API.

Key Changes:
- Deleted `create_backup.py` and `restore_backup.py`.
- Added `op_create_backup.py` and `op_restore_backup.py` to `graph_operations` for improved modularity.
- Updated response handling and request structures to support new operation envelopes and error models.

This refactor aims to streamline the backup and restore processes, making them more consistent with other graph operations.
…rClient

This commit removes the `ReportClient` from the `__init__.py` and `facade.py` files, consolidating report-related functionality within the `LedgerClient`. The `LedgerClient` now includes methods for creating, listing, retrieving, regenerating, deleting, and sharing reports, enhancing its capabilities and maintaining backward compatibility through an alias for report handling.

Key Changes:
- Removed `ReportClient` imports and references.
- Added report handling methods to `LedgerClient`, including `create_report`, `list_reports`, `get_report`, `regenerate_report`, `delete_report`, and `share_report`.
- Updated internal documentation to reflect the new report handling structure.

These changes streamline the client architecture and improve the organization of report-related operations.
…onality into LedgerClient

This commit deletes the `ReportClient` and its corresponding unit tests, transferring all report-related operations to the `LedgerClient`. The changes streamline the client architecture by centralizing report handling, which includes creating, listing, retrieving, regenerating, deleting, and sharing reports.

Key Changes:
- Removed `report_client.py` and `test_report_client.py`.
- Integrated report handling methods into `LedgerClient`.
- Updated documentation to reflect the new structure.

These modifications enhance maintainability and reduce redundancy in the codebase.
…andling

This commit modifies the documentation in `ledger_client.py` to clarify that reports, statements, and publish lists are now included within the `LedgerClient`. This change aligns with the recent consolidation of report functionality from the `ReportClient`, enhancing clarity regarding the client’s capabilities and its backend operations.
@jfrench9 jfrench9 merged commit c276abf into main Apr 16, 2026
1 check passed
@jfrench9 jfrench9 deleted the feature/graph-ops branch April 16, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant